<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/8/3
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>后台管理</title>
    <%@ taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"  %>
    <link rel="stylesheet" type="text/css" href="../css/main.css">
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
    <script src="../js/jquery-1.12.4.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="../js/bootstrap.min.js"></script>
    <style>
        .container input {
            width: 100%;
        }

        .container div {
            margin: 5px 0px;
            outline: none;
        }
    </style>
    <script>
        function getALLOrder() {
            $.getJSON("/login/getOtherOrder",
                    function (json, status) {
                        if (json.isadd == 0) {

                        } else {
                            var orderone = json.orderones;
                            var tr = "<tr >" +
                                    "<td>" + orderone.orderid + "</td>" +
                                    "<td>" + orderone.username + "</td>" +
                                    "<td>" + orderone.userphone + "</td>" +
                                    "<td>" + orderone.useraddress + "</td>" +
                                    "<td>" + orderone.paytype + "</td>" +
                                    "<td>" + orderone.paytime + "</td>" +
                                    "<td><a href='/goods/selectcar2?orderid=" + orderone.orderid + "' style='cursor: pointer'>详单</a></td>" +
                                    "<td><a href='/goods/setispost?orderid=" + orderone.orderid + "' style='cursor: pointer'>配送</a></td>" +
                                    "</tr>"
                            $("#newtable").append(tr);
                        }
                    })
            setTimeout("getALLOrder()", 500);
        }
            setTimeout("getALLOrder()", 1);
    </script>
</head>
<body>

<nav class="navbar navbar-default" role="navigation">
    <label class="navbar-brand">超贝订餐助手</label>
    <div class="navbar-header">
    </div>
    <div>
        <ul class="nav navbar-nav">
            <li><a href="/Manager/back">退出登录</a></li>
            <li class="active"><a>订单管理</a></li>
            <li><a href="/Manager/copyuser">用户管理</a></li>
            <li ><a href="/Manager/copyfood">菜品管理</a></li>
        </ul>
    </div>
</nav>
</div>




<div class="container">
    <table class="table tab-striped" id="newtable">
        <thead>
        <tr>
            <th>订单号</th>
            <th>用户名</th>
            <th>电话</th>
            <th>地址</th>
            <th>付款方式</th>
            <th>下单时间</th>
            <th>详细</th>
            <th>配送</th>
        </tr>
        </thead>
        <tbody>
        <jstl:forEach  items="${orderones}" var="orderone">
            <tr >
                <td>${orderone.orderid}</td>
                <td>${orderone.username}</td>
                <td>${orderone.userphone}</td>
                <td>${orderone.useraddress}</td>
                <td>${orderone.paytype}</td>
                <td>${orderone.paytime}</td>
                <td><a href="/goods/selectcar2?orderid=${orderone.orderid}" style="cursor: pointer">详单</a></td>
                <jstl:choose>
                    <jstl:when test="${orderone.ispost==0}">
                        <td><a href="/goods/setispost?orderid=${orderone.orderid}" style="cursor: pointer">配送</a></td>
                    </jstl:when>
                    <jstl:otherwise>
                        <td>配送</td>
                    </jstl:otherwise>
                </jstl:choose>

            </tr>
        </jstl:forEach>
        </tbody>
    </table>
</div>


</body>
</html>
